package com.zjzywl.smoke.dispatch;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.stereotype.Component;

import com.zjzywl.smoke.task.TaskManager;

@Component
public class IotssDisposableBean implements DisposableBean, ExitCodeGenerator {

	@Autowired
	private TaskManager t;

	@Override
	public void destroy() throws Exception {
		System.out.println("准备退出");
		t.stopTask();
	}

	@Override
	public int getExitCode() {
		return 5;
	}
}
